package ch15;

import java.util.Objects;

public class SetStaff {
    private String name;
    private int age;
    private String gender;
    private String post;
    private double salary;
    private String no;

    public SetStaff(String name, int age, String gender, String post, double salary, String no) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.post = post;
        this.salary = salary;
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SetStaff setStaff = (SetStaff) o;
        return Objects.equals(no, setStaff.no);
    }

    @Override
    public int hashCode() {
        return Objects.hash(no);
    }

    //输出最高工资单员工信息
    public void show(){
        System.out.println("姓名："+name+",年龄："+age+",性别："
                +gender+",职位:"+post+",薪资："+salary+",工号："+no);
    }

    @Override
    public String toString() {
        return "员工{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", post='" + post + '\'' +
                ", salary=" + salary +
                ", no='" + no + '\'' +
                '}';
    }
}
